package es.udima.geo.geoserver.entities;

import java.util.Collection;
import java.util.HashSet;
import java.util.Set;

public class UserUpdateResult {

    private User user;
    private Set<UserUpdateResultError> errors;

    public UserUpdateResult() {
	errors = new HashSet<UserUpdateResultError>();
    }

    public User getUser() {
	return user;
    }

    public void setUser(User user) {
	this.user = user;
    }

    public boolean isUpdateSuccessful() {
	return errors.isEmpty();
    }

    public Collection<UserUpdateResultError> getErrors() {
	return errors;
    }

    public void addError(UserUpdateResultError error) {
	this.errors.add(error);
    }

    public void addErrors(Collection<UserUpdateResultError> errors) {
	this.errors.addAll(errors);
    }
}
